﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations;

namespace TraceThisItem.Domain.Initializers
{
    public class WorkFlowConfiguration : EntityTypeConfiguration<Workflow>
    {
        public WorkFlowConfiguration()
        {
			HasKey(wf => wf.Id)
				.Property(wf => wf.Id)
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            Property(wf => wf.Name)
                .HasMaxLength(20)
                .IsRequired()
				.IsUnicode(false);

			HasMany(wf => wf.ItemTypes)
				.WithRequired(it => it.Workflow)
				.WillCascadeOnDelete(false);
          
            //Ignore(wf => wf.Description);        


        }
    }
}
